import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import externals from "vite-plugin-inject-externals";
import project from "./package.json";

// https://vitejs.dev/config/
export default defineConfig({
    build: {
        lib: {
            entry: `./src/${project.name}.ts`,
            name: project.name,
            formats: ["umd"],
        },
        watch: {},
    },
    plugins: [
        vue(),
        externals({
            modules: [
                {
                    name: "vue",
                    global: "x.common.vue",
                },
                {
                    name: "x.host",
                    global: "x.host",
                },
                {
                    name: "x.common",
                    global: "x.common",
                },
            ],
        }),
    ],
});
